package me.helllp.bootman.core.factory;

import java.util.List;

import me.helllp.bootman.core.service.FactoryService;

/**
 * 构造模块
 * 
 * @author Administrator
 *
 */
public class ModelFactory implements FactoryService{

	private ControllerFactory controllerFactory;
	
	private ServiceFactory serviceFactory;
	
	private ServiceImplFactory serviceImplFactory;

	private List<VoFactory> voFacotryList;
	
	public ModelFactory(
			ControllerFactory controllerFactory,
			ServiceFactory serviceFactory,
			ServiceImplFactory serviceImplFactory,
			List<VoFactory> voFacotryList){
		this.controllerFactory = controllerFactory;
		this.serviceFactory = serviceFactory;
		this.serviceImplFactory = serviceImplFactory;
		this.voFacotryList = voFacotryList;
	}
	
	@Override
	public boolean putOut(String path) throws Exception {
		
		this.controllerFactory.putOut(path + System.getProperty("file.separator") + "web");
		this.serviceFactory.putOut(path + System.getProperty("file.separator") + "services");
		this.serviceImplFactory.putOut(path + System.getProperty("file.separator") + "services" + System.getProperty("file.separator") + "impl");
		
		for(VoFactory voFactory : voFacotryList){
			voFactory.putOut(path + System.getProperty("file.separator") + "vo");
		}
		
		return true;
	}
	

}
